# 创建数组
# https://www.bilibili.com/video/BV19T4y127Z2/?spm_id_from=333.999.0.0&vd_source=8bd7b24b38e3e12c558d839b352b32f4
import numpy as np

print("numpy")

arr1 = np.array([1, 2, 3, 4])
print(arr1)
print(type(arr1))

arr_zero = np.zeros((3, 4))
print(arr_zero)

arr_zero = np.zeros((3, 4), dtype=np.int32)
print(arr_zero)

arr_one = np.ones((4, 5))
print(arr_one)

arr_empty = np.empty((5, 6))
print(arr_empty)

arr_eye = np.eye(4)
print(arr_eye)

arr_eye = np.eye(4, 6)
print(arr_eye)

arr_even = np.arange(2, 4, .2)
print(arr_even)

arr2d = [[1, 2, 3], [4, 5, 6]]
arr2dnp = np.array(arr2d)
print(arr2dnp)
print(arr2dnp.shape)

arr = np.arange(6)
print(arr)

arr2d = np.arange(6).reshape((2, 3))
print(arr2d)

arr3 = np.ones_like(arr2d)
print(arr3)

# 看numpy中的函数
print(dir(np))
